export default {
	async uploadFile(url, filePath) {
		const [error, success] = await uni.uploadFile({
			url: url,
			filePath: filePath,
			name: 'file',
			formData: {
				'user': 'user',
				'token': uni.getStorageSync('token')
			}
		});
		if (success) {
			return JSON.parse(success.data);
		} else {
			return error
		}
	}
}